<script setup>
import { ref } from 'vue'
import TitleValue from '@components/TitleValue'
import { common } from '@utils'
import { SERVE_URL,imgSERVEURL } from '@utils/config'

defineProps({
    types: Array
})

const visible = ref(false)
const data = ref()

const open = (value) => {
    data.value = value
    visible.value = true
}

const close = () => {
    visible.value = false
    data.value = {}
}

//把方法暴露给父组件
defineExpose({
    open
})
</script>
    
<template>
    <el-dialog v-model="visible" title="详情" center @close="close" destroy-on-close :width="500">
        <section>
            <title-value title="手机号" :value="data.mobile" />
            <title-value title="姓名" :value="data.name" />
            <title-value title="身份证" :value="data.userIdCard" />
            <title-value title="状态" :value="data.status == 1 ? '是':'否'" />
            <div class="flex-align paddingY6">
                <el-image class="flex1" v-if="data.userFrontImage" :src="imgSERVEURL + data.userFrontImage" :preview-src-list="[imgSERVEURL + data.userFrontImage]"></el-image>
                <el-image class="flex1 marginL15" v-if="data.userBehindImage" :src="imgSERVEURL + data.userBehindImage" :preview-src-list="[imgSERVEURL + data.userBehindImage]"></el-image>
            </div>
        </section>
    </el-dialog>
</template>
    